// in _settings.scss there are all variables used here
@import 'settings';

html {
    height: auto;
    min-height: 100%;
}

body {
    font-family: $main-font;
    font-weight: $main-font-weight;
    background-color: darken($color-main-light, 5%);
    min-height: 100%;
    overflow-x: hidden;
    &.nicescroll {
        overflow-y: hidden;
    }
}

a {
    color: $color-main-contrast;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: $headers-weight;
    font-family: $headers-font;
    text-transform: $headers-transform;
    color: $color-headers;
    a, a:hover, a:focus, a:active {
        color: inherit;
        text-decoration: none;
    }
}

p, ul, ol {
    font-family: $main-font;
    font-weight: $main-font-weight;
}

pre {
    margin-bottom: rem-calc(20);
}

.row {
    width: 100%;
    max-width: $row-max-width;
    .column, .columns {
        padding-left: rem-calc(30);
        padding-right: rem-calc(30);
    }
    &.row-with-header-logo {
        max-width: none;
        .column, .columns {
            padding-left: rem-calc(15);
            padding-right: rem-calc(15);
        }
    }
}

.button, button {
    font-family: $main-font;
}

a.button {
    text-decoration: none;
    color: $color-main-light;
    &:hover, &:active, &:focus {
        text-decoration: none;
        color: $color-main-light;
    }
}

[class*="block-grid-"] {
    margin: 0;
}

::-webkit-scrollbar {
    width: rem-calc(10);
    background-color: $color-main-light;
}
::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 rem-calc(6) rgba($color-main-dark, .3);
    background-color: $color-main-light;
}
::-webkit-scrollbar-thumb {
    -webkit-box-shadow: inset 0 0 rem-calc(6) rgba($color-main-dark, .3);
    background-color: $color-main-dark;
}

.back-to-top-btn {
    display: none;
    background-color: $color-main-dark;
    color: $color-main-light;
    position: fixed;
    bottom: 0;
    right: rem-calc(45);
    width: rem-calc(50);
    height: rem-calc(40);
    line-height: rem-calc(40);
    text-align: center;
    cursor: pointer;
    transition: all .4s;
    -webkit-transition: all .4s;
    border-radius: rem-calc(3) rem-calc(3) 0 0;
    z-index: 999;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    &.hidden {
        -webkit-transform: translateY(100%);
        -ms-transform: translateY(100%);
        transform: translateY(100%);
    }
    &:hover, &:focus, &:active {
        color: $color-main-light;
        background-color: lighten($color-main-dark, 5%)
    }
    .glyphicon {
        vertical-align: middle;
    }
    @media only screen and (min-width: 40.063em) {
        display: block;
    }
}

.headroom {
    padding: rem-calc(20);
    -webkit-transition: -webkit-transform .5s;
    -ms-transition: -ms-transform .5s;
    transition: transform .5s;
    background-color: $color-main-dark;
    color: $color-main-light;
    position: fixed;
    z-index: 10;
    right: 0;
    left: 0;
    top: 0;
    -webkit-transform: translate3d(0, -100%, 0);
    -ms-transform: translate(0, -100%);
    transform: translate3d(0, -100%, 0);
    &.headroom--not-top {
        -webkit-transform: translate3d(0, 0, 0);
        -ms-transform: translate(0, 0);
        transform: translate3d(0, 0, 0);
    }
    &.headroom--top {
        -webkit-transform: translate3d(0, -100%, 0);
        -ms-transform: translate(0, -100%);
        transform: translate3d(0, -100%, 0);
    }
    .headroom-logo {
        svg {
            vertical-align: middle;
            border-radius: rem-calc(6);
        }
    }
    .headeroom-icons {
        line-height: rem-calc(50);
        font-size: rem-calc(36);
        .glyphicon {
            cursor: pointer;
            height: rem-calc(50);
            line-height: rem-calc(50);
            vertical-align: middle;
        }
    }
}

// hacks for old android and ie9 buggy behaviour
html[data-useragent*='Android 4.0'],
html[data-useragent*='Android 4.1'],
html[data-useragent*='Android 4.2'],
html.no-csstransforms3d {
    .headroom {
        top: -300px;
        -webkit-transition: top .5s;
        transition: top .5s;
        &.headroom--not-top {
            top: 0;
        }
        &.headroom--top {
            top: -300px;
        }
    }
}

.big-search {
    position: absolute;
    width: 100%;
    min-height: 100%;
    top: 0;
    left: 0;
    background: rgba($color-main-dark, .95);
    -webkit-user-select: none;
    user-select: none;
    opacity: 0;
    visibility: hidden;
    -webkit-transition: opacity 0.5s, visibility 0s 0.5s;
    transition: opacity 0.5s, visibility 0s 0.5s;
    z-index: 99999;
    overflow-y: auto;
    .big-search-close-btn {
        font-size: rem-calc(60);
        text-align: center;
        position: absolute;
        right: rem-calc(35);
        top: rem-calc(35);
        overflow: hidden;
        border: none;
        color: $color-main-light;
        outline: none;
        z-index: 100;
        cursor: pointer;
        -webkit-user-select: none;
        user-select: none;
    }
    &.open {
        opacity: 1;
        visibility: visible;
        -webkit-transition: opacity 0.5s;
        transition: opacity 0.5s;
    }
    .big-search-container {
        margin-top: 11%;
        .big-search-form-input {
            color: $color-main-light;
            height: rem-calc(120);
            font-size: rem-calc(50);
            padding: rem-calc(20) 0;
            font-weight: 900;
            background-color: transparent;
            box-shadow: none;
            border: 0;
            border-bottom: rem-calc(3) solid $color-main-light;
            &:focus {
                box-shadow: none;
                background-color: transparent;
            }
            &::-webkit-input-placeholder {
                color: $color-main-light;
            }
            &:-moz-placeholder {
               color: $color-main-light;
               opacity: 1;
            }
            &::-moz-placeholder {
               color: $color-main-light;
               opacity: 1;
            }
            &:-ms-input-placeholder {
               color: $color-main-light;
            }
        }
        .big-search-results {
            color: $color-main-light;
            > p {
                font-weight: 600;
                font-size: rem-calc(36);
                // border-bottom: rem-calc(2) solid $color-main-light;
                padding-top: rem-calc(15);
                padding-bottom: rem-calc(15);
            }
            a {
                color: $color-main-light;
                p, h1, h2, h3, h4, h5, h6 {
                    color: $color-main-light;
                    font-weight: 400;
                    text-transform: none;
                    -webkit-transition: color .3s;
                    transition: color .3s;
                }
                &:hover, &:active, &:focus {
                    text-decoration: none;
                }
                &:hover {
                    p, h1, h2, h3, h4, h5, h6 {
                        color: darken($color-main-light, 40%);
                    }
                }
            }
        }
    }
}

.big-header-container {
    position: relative;
    z-index: 1;
    .main-header {
        text-align: left;
        color: $color-main-light;
        .main-header-content {
            padding-top: rem-calc(37);
            padding-bottom: rem-calc(60);
            .blog-logo {
                svg {
                    vertical-align: middle;
                    border-radius: rem-calc(6);
                }
            }
            .page-description span {
                padding: 0 rem-calc(6);
                border-radius: rem-calc(6);
                margin-left: rem-calc(-6);
                background-color: rgba(35, 35, 35, 0.5);
            }
            @media only screen and (min-width: 48em) {
                padding-top: rem-calc(70);
            }
            @media only screen and (min-width: 64em) {
                padding-top: rem-calc(100);
            }
        }
        .page-title {
            color: $color-main-light;
            font-weight: 800;
            font-size: rem-calc(46);
            @media only screen and (min-width: 48em) {
                font-size: rem-calc(60);
            }
            @media only screen and (min-width: 64em) {
                font-size: rem-calc(80);
            }
        }
        .page-description {
            font-weight: 400;
            color: $color-main-light;
        }
        .main-header-logo-container {
            .main-header-logo {
                img {
                    max-height: rem-calc(100);
                }
            }
        }
        .main-header-bars {
            position: absolute;
            right: rem-calc(15);
            top: 0;
            width: rem-calc(90);
            height: rem-calc(100);
            font-size: rem-calc(36);
            text-align: center;
            z-index: 2;
            .glyphicon {
                cursor: pointer;
                line-height: rem-calc(100);
                height: rem-calc(100);
                vertical-align: middle;
            }
            @media only screen and (min-width: 48em) {
                right: rem-calc(30);
            }
        }
    }
}

.index-filters {
    height: rem-calc(60);
    line-height: rem-calc(60);
    background-color: $color-main-light;
    a {
        display: inline-block;
        color: $color-main-dark;
        outline: none;
        &:focus, &:active {
            color: inherit;
        }
        &:hover {
            color: lighten($color-main-dark, 10%);
        }
    }
    ul.inline-list {
        vertical-align: middle;
        display: inline-block;
        line-height: inherit;
        a {
            -webkit-transition: color 0.5s;
            transition: color 0.5s;
            &:hover {
                color: $color-main-contrast;
            }
        }
    }
}

.main-content-wrapper {
    position: relative;
    overflow: hidden;
}

.loop {
    padding-top: rem-calc(30);
    padding-bottom: rem-calc(60);
    .post-row {
        padding-left: rem-calc(15);
        padding-right: rem-calc(15);
        max-width: $row-max-width;
        margin-left: auto;
        margin-right: auto;
        @media only screen and (min-width: 48em) {
            padding-left: rem-calc(30);
            padding-right: rem-calc(30);
        }
        .post-block-grid {
            .post-block-grid-item {
                float: left;
                width: 100%;
                @media only screen and (min-width: 62.5em) {
                    width: 50%;
                }
                .post-block-wrapper {
                    overflow: hidden;
                }
                &.list {
                    @media only screen and (min-width: 62.5em) {
                        width: 100%;
                    }
                    .post-block-wrapper {
                        background-color: $color-main-light;
                        figure {
                            width: 100%;
                            @media only screen and (min-width: 48em) {
                                width: 40%;
                            }
                        }
                        .post-block-grid-content {
                            width: 100%;
                            @media only screen and (min-width: 48em) {
                                width: 60%;
                            }
                            &.no-image {
                                width: 100%;
                            }
                        }
                    }
                }
            }
            .post-block-grid-content {
                background-color: $color-main-light;
                padding: rem-calc(30);
                overflow-x: hidden;
                .index-post-image {
                    display: block;
                }
                section p {
                    hyphens: auto;
                }
                @media only screen and (min-width: 40.063em) {
                    padding: rem-calc(50);
                }
                .post-preview a {
                    @include corner-link;

                    &[href^="mailto:"]:after {
                        content: "";
                    }
                }
            }
            // image hover effects based on great article
            // http://tympanus.net/Development/HoverEffectIdeas/index.html
            figure {
                position: relative;
                float: left;
                overflow: hidden;
                width: 100%;
                text-align: center;
                text-align: center;
                cursor: pointer;
                margin: 0;
                background-color: $color-main-light;
                @extend %clearfix;
                img {
                    position: relative;
                    display: block;
                    max-width: 100%;
                    margin: 0 auto;
                }
                figcaption {
                    padding: 2em;
                    color: #fff;
                    text-transform: uppercase;
                    font-size: 1.25em;
                    -webkit-backface-visibility: hidden;
                    backface-visibility: hidden;
                    position: absolute;
                    top: 0;
                    left: 0;
                    width: 100%;
                    height: 100%;
                    > a {
                        position: absolute;
                        top: 0;
                        left: 0;
                        width: 100%;
                        height: 100%;
                        z-index: 1000;
                        text-indent: 200%;
                        white-space: nowrap;
                        font-size: 0;
                        opacity: 0;
                    }
                    &::after, &::before {
                        pointer-events: none;
                    }
                }
                p {
                    margin: 0;
                    letter-spacing: 1px;
                    font-size: 68.5%;
                }
                &.effect-hera {
                    p {
                        position: absolute;
                        top: 50%;
                        left: 50%;
                        -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
                        -ms-transition: opacity 0.35s, -ms-transform 0.35s;
                        transition: opacity 0.35s, transform 0.35s;
                        -webkit-transform: translate3d(-50%, -50%, 0);
                        -ms-transform: translate(-50%, -50%);
                        transform: translate3d(-50%, -50%, 0);
                        -webkit-transform-origin: 50%;
                        -ms-transform-origin: 50%;
                        transform-origin: 50%;
                        width: 100px;
                        text-transform: none;
                        font-size: 121%;
                        line-height: 2;
                        a {
                            color: $color-main-light;
                            outline: none;
                            i, span {
                                outline: none;
                                opacity: 0;
                                font-size: rem-calc(32);
                                -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
                                -ms-transition: opacity 0.35s, -ms-transform 0.35s;
                                transition: opacity 0.35s, transform 0.35s;
                            }
                            &:first-child {
                                i, span {
                                    -webkit-transform: translate3d(rem-calc(-60), rem-calc(-60), 0);
                                    -ms-transform: translate(rem-calc(-60), rem-calc(-60));
                                    transform: translate3d(rem-calc(-60), rem-calc(-60), 0);
                                }
                            }
                            &:nth-child(2) {
                                i, span {
                                    -webkit-transform: translate3d(rem-calc(60), rem-calc(-60), 0);
                                    -ms-transform: translate(rem-calc(60), rem-calc(-60));
                                    transform: translate3d(rem-calc(60), rem-calc(-60), 0);
                                }
                            }
                            &:hover {
                                opacity: 0.6;
                                text-decoration: none;
                            }
                        }
                    }
                    figcaption {
                        &::before {
                            position: absolute;
                            top: 50%;
                            left: 50%;
                            width: rem-calc(170);
                            height: rem-calc(170);
                            border: rem-calc(2) solid #fff;
                            content: '';
                            opacity: 0;
                            -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
                            -ms-transition: opacity 0.35s, -ms-transform 0.35s;
                            transition: opacity 0.35s, transform 0.35s;
                            -webkit-transform: translate3d(-50%, -50%, 0) rotate3d(0,0,1,-45deg) scale3d(0,0,1);
                            -ms-transform: translate(-50%, -50%);
                            transform: translate3d(-50%, -50%, 0) rotate3d(0,0,1,-45deg) scale3d(0,0,1);
                            -webkit-transform-origin: 50%;
                            -ms-transform-origin: 50%;
                            transform-origin: 50%;
                        }
                    }
                    &:hover {
                        figcaption {
                            &::before {
                                opacity: 1;
                                -webkit-transform: translate3d(-50%, -50%, 0) rotate3d(0, 0, 1, -45deg) scale3d(1, 1, 1);
                                -ms-transform: translate(-50%, -50%);
                                transform: translate3d(-50%, -50%, 0) rotate3d(0, 0, 1, -45deg) scale3d(1, 1, 1);
                            }
                        }
                        p {
                            i, span {
                                &:empty {
                                    -webkit-transform: translate3d(0, 0, 0);
                                    -ms-transform: translate(0, 0);
                                    transform: translate3d(0, 0, 0);
                                    opacity: 1;
                                }
                            }
                        }
                    }
                }
            }
            @include flash-messages;
        }
        .post {
            padding-top: rem-calc(15);
            padding-bottom: rem-calc(15);
            -webkit-transition: all .3s;
            transition: all .3s;
            .post-date {
                font-weight: 900;
                font-size: rem-calc(14);
                text-transform: uppercase;
                a {
                    color: $color-main-contrast;
                    position: relative;
                    display: inline-block;
                    &:after {
                        position: absolute;
                        content: " ";
                        display: block;
                        width: 0%;
                        height: rem-calc(2);
                        background-color: $color-main-contrast;
                        bottom: 0;
                        left: 50%;
                        -webkit-transform: translateX(-50%);
                        -ms-transform: translateX(-50%);
                        transform: translateX(-50%);
                        -webkit-transition: width .2s;
                        transition: width .2s;
                    }
                    &:hover, &:focus, &:active {
                        text-decoration: none;
                        color: $color-main-contrast;
                        &:after {
                            width: 100%;
                        }
                    }
                }
            }
            .post-title {
                font-weight: 900;
                text-transform: $headers-transform;
                line-height: 1.1;
                padding-bottom: rem-calc(10);
                padding-top: rem-calc(10);
                &.draft-title {
                    color: lighten($color-main-dark, 50%);
                }
            }
            .post-title-separator {
                width: rem-calc(70);
                height: rem-calc(5);
                margin-bottom: rem-calc(20);
                background-color: $color-main-dark;
            }
            .post-meta {
                font-weight: 600;
                padding-top: rem-calc(15);
                padding-bottom: rem-calc(15);
                font-size: rem-calc(12);
                text-transform: uppercase;
                a {
                    color: $color-main-contrast;
                    position: relative;
                    display: inline-block;
                    &:after {
                        position: absolute;
                        content: " ";
                        display: block;
                        width: 0%;
                        height: rem-calc(2);
                        background-color: $color-main-contrast;
                        bottom: 0;
                        left: 50%;
                        -webkit-transform: translateX(-50%);
                        -ms-transform: translateX(-50%);
                        transform: translateX(-50%);
                        -webkit-transition: width .2s;
                        transition: width .2s;
                    }
                    &:hover, &:focus, &:active {
                        text-decoration: none;
                        color: $color-main-contrast;
                        &:after {
                            width: 100%;
                        }
                    }
                    &.to-comments {
                        color: $color-main-dark;
                        &:after {
                            background-color: $color-main-dark;
                        }
                    }
                }
            }
            .job-item {
                margin-bottom: rem-calc(30);
                .job-emoji {
                    float: left;
                    font-size: rem-calc(42);
                    margin-right: rem-calc(20);
                }
                .job-dates {
                    color: lighten($color-main-dark, 50%);
                    font-size: 75%;
                    margin-top: rem-calc(6);
                }
            }
        }
        .post-read-more-btn {
            @include read-more-button;
        }
    }
}

.author-template .loop .post-row .post-block-grid figure {
    cursor: default;
}

.tag-view-info {
    height: rem-calc(100);
    line-height: rem-calc(100);
    background-color: $color-main-light;
    font-weight: 400;
    font-size: rem-calc(24);
    text-transform: uppercase;
    position: relative;
    .tag-view-label {
        height: rem-calc(100);
        line-height: rem-calc(100);
        float: left;
        margin-top: rem-calc(2);
        padding-left: 0.3em;
        .tag-view-label-text {
            display: none;
            @media only screen and (min-width: 48em) {
                display: inline;
            }
        }
    }
    .back-to-index {
        color: $color-main-dark;
        height: rem-calc(100);
        line-height: rem-calc(100);
        float: left;
        .glyphicon {
            -webkit-transition: -webkit-transform .2s;
            -ms-transition: -ms-transform .2s;
            transition: transform .2s;
        }
        &:hover {
            color: $color-main-dark;
            .glyphicon {
                -webkit-transform: translateX(-15%);
                -ms-transform: translateX(-15%);
                transform: translateX(-15%);
            }
        }
    }
    .glyphicon {
        top: 0;
        vertical-align: middle;
    }
    .tag-name {
        font-weight: 900;
    }
}

.author-view-info {
    background-color: $color-main-light;
    font-weight: 400;
    font-size: rem-calc(24);
    position: relative;
    .author-name {
        margin-top: rem-calc(25);
        font-weight: 900;
        font-size: rem-calc(30);
        font-family: $headers-font;
        text-transform: uppercase;
        .author-name-social-icons {
            font-size: rem-calc(24);
            a {
                display: inline-block;
                margin-left: rem-calc(6);
                margin-right: rem-calc(3);
                color: $color-main-contrast;
                vertical-align: text-bottom;

                &:first-child {
                    margin-left: rem-calc(16);
                }
                .icon svg {
                    height: 1em;
                    width: 1em;
                    top: rem-calc(5);
                    position: relative;
                    fill: $color-main-contrast;
                    -webkit-transition: fill 0.5s;
                    transition: fill 0.5s;
                    &:hover {
                        fill: $color-main-dark;
                    }
                }
            }
        }
    }
    .author-bio {
        font-size: rem-calc(18);
        text-transform: none;
        margin-bottom: rem-calc(25);
    }
    .author-avatar {
        .author-rss {
            position: absolute;
            bottom: rem-calc(5);
            right: 0;
            z-index: 99;
            padding: rem-calc(10) rem-calc(15) rem-calc(5);
            background-color: $color-main-light;
            line-height: 1.1;
            height: auto;
            border-radius: rem-calc(15);
            color: $color-main-dark;
            .icon svg {
                height: rem-calc(20);
                width: rem-calc(20);
                fill: $color-main-dark;
                -webkit-transition: fill 0.5s;
                transition: fill 0.5s;
                &:hover {
                    fill: #EE802F;
                }
            }
        }
        .author-avatar-img {
            display: block;
            position: absolute;
            max-width: rem-calc(250);
            border: rem-calc(20) solid $color-main-light;
            bottom: rem-calc(5);
            right: 0;
        }
        display: none;
        @media only screen and (min-width: 64em) {
            display: block;
        }
    }
}

.footer {
    background-color: $color-main-dark;
    text-align: center;
    color: darken($color-main-light, 30%);
    padding-top: rem-calc(80);
    padding-bottom: rem-calc(80);
    .footer-social-icons {
        a {
            margin-right: rem-calc(4);
            &:last-child {
                margin-right: 0;
            }
            color: $color-main-dark;
            &:hover, &:focus, &:active {
                color: $color-main-dark;
            }
            @include social-icons;
        }
    }
    .footer-poweredby {
        margin-top: rem-calc(10);
        a {
            color: darken($color-main-light, 30%);
            -webkit-transition: color 0.5s;
            transition: color 0.5s;
            &:hover, &:focus, &:active {
                color: $color-main-contrast;
            }
        }
    }
}

html[data-useragent*='MSIE 9.0'] .footer .footer-social-icons a .icon svg {
    width: 2em;
}

// loop pagination
.pagination {
    margin-top: rem-calc(55);
    text-align: center;
    a {
        @include read-more-button;
        .glyphicon {
            font-size: rem-calc(12);
            margin: 0 rem-calc(5) 0;
        }
    }
}

$placeholder-font-color: #bbb;
form {
    ::placeholder {
        color: $placeholder-font-color;
    }
    ::-webkit-input-placeholder {
        color: $placeholder-font-color;
    }
    :-moz-placeholder { /* Firefox 18- */
        color: $placeholder-font-color;
        opacity: 1;
    }
    ::-moz-placeholder { /* Firefox 19+ */
        color: $placeholder-font-color;
        opacity: 1;
    }
    :-ms-input-placeholder { /* Internet Explorer 10-11 */
        color: $placeholder-font-color;
    }
    ::-ms-input-placeholder { /* Microsoft Edge */
        color: $placeholder-font-color;
    }
}
